OpenStack Icehouse : How to Use Ceilometer
2015/02/06 |
How to use the OpenStack Metering Service (Ceilometer).
This example is based on the environment like follows.
| +------------------+ | +------------------------+ | [ Control Node ] | | | [ Network Node ] | | Keystone |10.0.0.30 | 10.0.0.50| DHCP,L3,L2 Agent | | Glance |------------+------------| Metadata Agent | | Nova API |eth0 | eth0| Ceilometer Services | | Neutron Server | | | | +------------------+ | +------------------------+ eth0|10.0.0.51 +--------------------+ | [ Compute Node ] | | Nova Compute | | L2 Agent | | Ceilometer-Compute | +--------------------+ |
[1] | After configuring Configure Ceilometer#1, Configure Ceilometer#2, Configure Ceilometer#3, if configuration of them are done normally, the command of follows answers without errors like follows. |
[root@dlp ~(keystone)]# ceilometer meter-list +------+------+------+-------------+---------+------------+ | Name | Type | Unit | Resource ID | User ID | Project ID | +------+------+------+-------------+---------+------------+ +------+------+------+-------------+---------+------------+ |
[2] | It's possible to monitor Compute Service (Nova) now. Try to create and start an instance, and next, input the command meter-list again, then meters are loged like follows. |
[root@dlp ~(keystone)]# Int_Net_ID=`neutron net-list | grep int_net | awk '{ print $2 }'` [root@dlp ~(keystone)]# nova boot --flavor 2 --image CentOS6 --security_group default --nic net-id=$Int_Net_ID CentOS_66 [root@dlp ~(keystone)]# ceilometer meter-list +---------------------+-------+----------+-----------------------+----------------------+---------------------+ | Name | Type | Unit | Resource ID | User ID | Project ID | +---------------------+-------+----------+-----------------------+----------------------+---------------------+ | disk.ephemeral.size | gauge | GB | eaf78cd9-07f8-4820... | 709ba07202cf4e93b... | 9b15b4c4f98a40da... | | disk.root.size | gauge | GB | eaf78cd9-07f8-4820... | 709ba07202cf4e93b... | 9b15b4c4f98a40da... | | instance | gauge | instance | eaf78cd9-07f8-4820... | 709ba07202cf4e93b... | 9b15b4c4f98a40da... | | instance.scheduled | delta | instance | eaf78cd9-07f8-4820... | 709ba07202cf4e93b... | 9b15b4c4f98a40da... | | instance:m1.small | gauge | instance | eaf78cd9-07f8-4820... | 709ba07202cf4e93b... | 9b15b4c4f98a40da... | | memory | gauge | MB | eaf78cd9-07f8-4820... | 709ba07202cf4e93b... | 9b15b4c4f98a40da... | | vcpus | gauge | vcpu | eaf78cd9-07f8-4820... | 709ba07202cf4e93b... | 9b15b4c4f98a40da... | +---------------------+-------+----------+-----------------------+----------------------+---------------------+ |
[3] | Configure to enable monitoring Image Service (Glance). |
[root@dlp ~(keystone)]#
vi /etc/glance/glance-api.conf # line 235: uncomment and change notification_driver = messaging
# line 242,243: uncomment and specify RabbitMQ server rabbit_host= 10.0.0.30 rabbit_port=5672 # line 245,246: uncomment and specify RabbitMQ userID and password rabbit_userid= guest rabbit_password= password
[root@dlp ~(keystone)]# /etc/rc.d/init.d/openstack-glance-api restart
# confirm the configuration [root@dlp ~(keystone)]# ceilometer meter-list +------+------+------+-------------+---------+------------+ | Name | Type | Unit | Resource ID | User ID | Project ID | +------+------+------+-------------+---------+------------+ +------+------+------+-------------+---------+------------+ # try to add a new image [root@dlp ~(keystone)]# glance image-create --name="CentOS66" --is-public=true --disk-format=qcow2 --container-format=bare < /var/kvm/images/centos6.img [root@dlp ~(keystone)]# ceilometer meter-list +---------------------+-------+----------+-----------------------+----------+---------------------+ | Name | Type | Unit | Resource ID | User ID | Project ID | +---------------------+-------+----------+-----------------------+----------+---------------------+ | image.update | delta | image | 9cd91fe5-f449-4d9a... | None | 9b15b4c4f98a40da... | | image.upload | delta | image | 9cd91fe5-f449-4d9a... | None | 9b15b4c4f98a40da... | +---------------------+-------+----------+-----------------------+----------+---------------------+ # meters are loged for Image Service |
[4] | Configure to enable monitoring Block Storage (Cinder). |
# change settings on both Control Node and Network Node [root@dlp ~(keystone)]# vi /etc/cinder/cinder.conf # add in the [DEFAULT] section
control_exchange=cinder
notification_driver=cinder.openstack.common.notifier.rpc_notifier # Control Node [root@dlp ~(keystone)]# for service in api scheduler; do /etc/rc.d/init.d/openstack-cinder-$service restart done # Network Node [root@network ~]# /etc/rc.d/init.d/openstack-cinder-volume restart
# confirm the configuration [root@dlp ~(keystone)]# ceilometer meter-list +------+------+------+-------------+---------+------------+ | Name | Type | Unit | Resource ID | User ID | Project ID | +------+------+------+-------------+---------+------------+ +------+------+------+-------------+---------+------------+[root@dlp ~(keystone)]# cinder create --display_name disk01 10 [root@dlp ~(keystone)]# ceilometer meter-list +---------------------+-------+----------+-----------------------+-------------------+--------------------+ | Name | Type | Unit | Resource ID | User ID | Project ID | +---------------------+-------+----------+-----------------------+-------------------+--------------------+ | volume | gauge | volume | 813a7145-9fb9-434c... | 709ba07202cf4e... | 9b15b4c4f98a40d... | | volume.size | gauge | GB | 813a7145-9fb9-434c... | 709ba07202cf4e... | 9b15b4c4f98a40d... | +---------------------+-------+----------+-----------------------+-------------------+--------------------+ # meters are loged for Block Storage Service |
[5] | Configure to enable monitoring Network Service (Neutron). |
# change settings on Control Node, Network Node, Compute Node [root@dlp ~(keystone)]# vi /etc/neutron/neutron.conf # line 196: uncomment notification_driver=neutron.openstack.common.notifier.rpc_notifier # Control Node [root@dlp ~(keystone)]# /etc/rc.d/init.d/neutron-server restart # Network Node [root@network ~]# for service in dhcp-agent l3-agent metadata-agent openvswitch-agent; do /etc/rc.d/init.d/neutron-$service restart done # Compute Node [root@node01 ~]# /etc/rc.d/init.d/neutron-openvswitch-agent restart
# confirm the configuration [root@dlp ~(keystone)]# ceilometer meter-list +------+------+------+-------------+---------+------------+ | Name | Type | Unit | Resource ID | User ID | Project ID | +------+------+------+-------------+---------+------------+ +------+------+------+-------------+---------+------------+[root@dlp ~(keystone)]# neutron net-create test_net [root@dlp ~(keystone)]# ceilometer meter-list +---------------------+-------+----------+-----------------------+-------------------+--------------------+ | Name | Type | Unit | Resource ID | User ID | Project ID | +---------------------+-------+----------+-----------------------+-------------------+--------------------+ | network | gauge | network | 2de8e4fe-7fb3-4fd3... | 709ba07202cf4e... | 9b15b4c4f98a40d... | | network.create | delta | network | 2de8e4fe-7fb3-4fd3... | 709ba07202cf4e... | 9b15b4c4f98a40d... | +---------------------+-------+----------+-----------------------+-------------------+--------------------+ # meters are loged for Network Service |